home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
BBS_UTL
/
TPK_104
/
TPK.DOC
< prev
next >
Wrap
Text File
|
1993-04-26
|
14KB
|
483 lines
-----------------------------------
Turbo Online Programming Kit
Version 1.04
By Jason Whittenburg
Turbo Programming Team
April 27, 1993
-----------------------------------
+-----------------------+
| LICENSING INFORMATION |
+-----------------------+
This program is not freeware. This is SHAREWARE which means it is
user supported software. If you wish to use these units in your
programs you are required to register it. The registration fee is
very small at a mere $25.00.
To distrubte any product made with these TPU's you must first
register this product with T.P.T.
You may not accept compensation for any program for any program made
with these TPU's without first obtaining a license from T.P.T. for
compensation.
You may not modify or remove the 'TPK Programming Kit Notice' from
the program or documentation.
Use of this product constitutes acceptance of these terms.
You will recive a compiled personal copy of TPK on disk when you
register. Updates are available for $3 on disk.
+------------------------------------------+
| ACKNOWLEDGEMENTS , LEGAL STUFF and MORE! |
+------------------------------------------+
Thanks to everyone who helped out testing this code and Stats
This programming kit was compiled under Borland Pascal v7 and
will function with Borland Pascal v7 in DOS REAL MODE and
Turbo Pascal v7.
Most of the commands in this kit will look fimilar to those used
JPDOOR v3.2 and BOI v2.0. I made them similar so I would not have
to convert my programs I'm working on. :-) So upgrading copies of
your programs that use these door kits should not be alot of work.
Borland Pascal is a trademark by Borland International, Inc
Turbo Pascal is a trademark by Borland International, Inc
JPDoor is CopyRight 1990-1992 by Motor City Software
BBS Onliner Interface is Copyright 1992 by Andrew J Mead
+-----------------+
| GETTING STARTED |
+-----------------+
TPK is a collection of routines to help you with your door
programming.
TPK takes care of all your communications, etc. It will not write
a door for you! Much programming is required to make any type of
online door. You will most likely require routines not found here,
but will the command and procedures here you should be able to easily
write your own shells to say display a text file.
To start up the routines of TPK you need to add the following line
to the main body of your program. TPK will start up automatically, but
it still requires at this time for you to run INITALIZE_DOOR.
Program SomeDoor;
Uses TPK, Multi;
{ Bunch of Procedures n' Functions }
Begin { Main Body }
INITALIZE_DOOR;
{ Your stuff }
End.
TPK is set up with command line paramators for the drop file and
other comm related information. These are...
/S - read DOOR.SYS (GAP, TAG, Renegade, etc style)
/D - read DORINFOx.DEF
/L - Local Logon
/C:x - Lock CommPort
/I:x - Lock IRQ
/B:x - Lock Baud
/T:x - Set Time Limit
/Q - Set for Quite mode (No local bell's)
<The output routines strip the ^G charactors from strings>
So when you run a program compiled with TPK, at least on of the
first three paramaters is required!
+-----------+
| REFERENCE |
+-----------+
This section is the reference to all the functions, constants,
variables and procedures that you may use in your programs.
Constants
---------
TPK_Version = '1.04';
Unit Types
----------
charset = set of char;
commode = (com_none,com_local,com_internal,com_fossil)
grmode = (gr_none,gr_ascii,gr_ansi,gr_avt);
Str39 = String[39];
TaskType = (notask,dv,dos5,dos6,win,os2);
TimeArr = Array[1..4]of word;
Unit Variables
--------------
TPK initializes these upon startup, they can be addressed.
AnsiX Boolean Color on(true)/off(false)
cmode commode What coom routines are used?
GameTime Integer Time spent in game so far
PageLength byte Size of the screen in lines
RealName Str39 Users complete Real Name
StartTime Timearr Time that game was initialized
StartDate Timearr Date that game was initialized
Tasker TaskType Operationg System/Enviroment
TicksLeft LongInt Time left in game (18.2 ticks per second)
Timeexp Boolean Time Expired Indicator
Tstr String String Discribing OS/Tasker
Tvers Word Version of OS/Tasker
UserName str39 Complete users name (handle)
Functions and Procedures
------------------------
The following functions and procedures are listed in the format:
=======================================================================
- Function or Procedure Name
- Function or Procedure & Interface Structure
- Description
- Usage Example
- Notes (sometimes)
=======================================================================
Function Center
Center(S:String; I:Byte) : String;
Centers a String (s) on a line (i) units long;
Display(0,7,0,Center('Howdy!',80));
=======================================================================
Procedure CleanString
CleanString(Var Clean : String);
Clears all spaces from the left and right of a string;
Line := ' Hi! ';
CleanString(Line);
(line) is now 'Hi!'
=======================================================================
Procedure ClearBuffers
ClearBuffers;
Clears the input buffer. Good to use before getting input.
=======================================================================
Procedure ClearScreen
ClearScreen;
Clears the remote and local Screens
=======================================================================
Procedure CLRPortEOL
CLRPortEOL;
Clears the remote and local Screens from the curson to the right edge
of the screen.
=======================================================================
Function CommaStr
CommaStr(I:LongInt) : String;
Inserts commas into numbers.
sDisplay(0,7,0,'You have $');
sDisplay(0,7,0,CommaStr(Money));
Display(0,7,0,' in the bank');
Output --> You Have $7,298,232 in the bank
=======================================================================
Procedure CRLF
CRLF;
This porcedure provides a Carrage Return, line feed sequence.
=======================================================================
Function DateDiff
DateDiff(Ubday : String) : real;
Returns the nuber of Julian Days between today and this date.
Where UBDAY is in the form mm/dd/yy.
DaysPast := DateDiff(birthday);
=======================================================================
Function DateDiff2
DateDiff2(Ubday : String) : real;
Returns the nuber of Julian Days between today and this date.
Where UBDAY is in the form mmddyy.
DaysPast := DateDiff(birthday);
=======================================================================
Procedure Display
Display(BackGround, ForeGround, Blink : Byte; Line : String[80]);
This procedure displays the line ('line') to both the local and remote
screens with a carrage return. Background and foreground are the
color attributes respectivly and blink is 0 for no blinking or 1 for
blinking.
Valid colors are standard ansi colors 0-15 and background 0-7
Background Colors:
0 - Black 3 - Cyan 6 - Brown
1 - Blue 4 - Red 7 - Light Grey
2 - Green 5 - Magenta
Foreground Colors:
0 - Black 4 - Red 8 - Dark Grey 12 - Light Red
1 - Blue 5 - Magenta 9 - Light Blue 13 - Light Magenta
2 - Green 6 - Brown 10 - Light Green 14 - Yellow
3 - Cyan 7 - Light Grey 11 - Light Cyan 15 - White
Display(0,15,0,'This is a white line');
Display(0,8,0,SomeStringVariable);
(Also see sDisplay)
=======================================================================
Procedure DiskSp
DiskSp(DriveNum : Integer; Var BytesFree, BytesCap : Real);
Returns the amount of bytes free and bytes capisity on drivenum
Drive num = Integer where 1 is A:, 2 is B:, etc...
DiskSp(3,free,capisity);
=======================================================================
Function Exist
Exist(FileName : String[80]) : Boolean;
Returns a True value if the file specified exists.
If Exist(FileName) then
Begin
=======================================================================
Procedure GetString
GetString(Var GetStr : String);
Gets string from local or remote screens, like Readln
GetString(InString);
=======================================================================
Procedure GotoPortXY
GotoPortXY(x,y : byte);
Moves the cursor to the X,Y position on the local and remote screens
GotoPort(10,10);
=======================================================================
Procedure Initalize_Door
Initalize_Door;
Initalize the startup routines for TPK and you door, it should be the
first thing you call.
=======================================================================
Function ITOA
ITOA(I:LongInt) : String;
Converts an Integer to a String
StrValue := ITOA(I);
Display(0,7,0,ITOA(I));
=======================================================================
Function LeftTime
LeftTime : Integer;
Returns the number of minutes remaining
TimeLeft := Lefttime;
=======================================================================
Function Max
Max(a,b : word) : word;
Returns the larger value of two words;
a:= max(x1,x2);
=======================================================================
Function Min
Min(a,b : word) : word;
Returns the smaller value of two words;
a:= min(x1,x2);
=======================================================================
Procedure Pause_It
Pause_It(x,y,c1,c2,c3,c4 : byte);
Animated Pause. x = x coord
y = y coord
c1 = color #1 (colors are ansi colors 0 - 15)
c2 = color #2
c3 = color #3
c4 = color #4
Pause_it(22,37,11,3,9,1);
=======================================================================
Procedure PortColumnOne
PortColumnOne;
Places cursor at left edge of current line
=======================================================================
Function PortKeyPressed
Until PortKeyPressed;
Replaces BP/TP's KeyPressed function.
Repeat
{ Stuff }
Until PortKeyPressed
=======================================================================
Procedure PortWindow
PortWindow(x1,y1,x2,y2);
Draw a window on both local and remote screens, replaces TP/BP's
Window procedure
PortWindow(1,1,80,25);
=======================================================================
Function ReadPortKey
Input := ReadportKey;
Get input from Remote ot Local Keyboard;
=======================================================================
Function RTOA
RealStr(I:Real; Rsize, Rdec:Byte) : String;
Converts an Real to a String. Rsize is number of chars and Rdec is
number of decimal places.
StrValue := RealStr(I,3,1);
Display(0,7,0,RealStr(I,3,1));
=======================================================================
Procedure sDisplay
sDisplay(BackGround, ForeGround, Blink : Byte; Line : String[80]);
This procedure displays the line ('line') to both the local and remote
screens WITHOUT a carrage return. Background and foreground are the
color attributes respectivly and blink is 0 for no blinking or 1 for
blinking.
sDisplay(0,15,0,'This is a white line, with blue exclmation points');
Display(0,9,0,'!!!');
=======================================================================
Function Valid
Valid(Filename : String[80]) : Boolean;
Returns a true value is the specified string is a valid MS-DOS file
name.
If Valid(Filename) then
begin
If Exist(FileName) then
begin
=======================================================================
Procedure Wrap
Wrap;
Closes down your door and saves all info.
+-------------+
| OTHER STUFF |
+-------------+
Hey, read the product list!!